<html>
<head><meta charset="utf-8"><title>starting up work again · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html">starting up work again</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="196231736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196231736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196231736">(May 04 2020 at 19:52)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="281950">@Aman Arora</span> -- are you all planning on getting started here? I'm wondering if we should try to find a time to sync up, perhaps with <span class="user-mention" data-user-id="128294">@blitzerr</span>,  and discuss what is required. I didn't find time to write out instructions, but I did find time to at least <em>start</em> reading into the work required :)</p>



<a name="196249213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196249213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196249213">(May 04 2020 at 22:46)</a>:</h4>
<p>We all just got done with our internships and our catching up on learning Rust. We'd like to get some plan ready soon, so that we can schedule other school work around it.</p>



<a name="196290549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196290549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196290549">(May 05 2020 at 10:30)</a>:</h4>
<p>OK, so, there is a certain amount of "Background reading" or watching that might make sense --</p>



<a name="196290558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196290558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196290558">(May 05 2020 at 10:30)</a>:</h4>
<p>I remember <span class="user-mention" data-user-id="128294">@blitzerr</span> and I recorded some videos --</p>



<a name="196290563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196290563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196290563">(May 05 2020 at 10:30)</a>:</h4>
<p>but I guess they are likely out of date</p>



<a name="196290571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196290571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196290571">(May 05 2020 at 10:30)</a>:</h4>
<p>I wonder if, to get started, we ought to try and schedule a "walk through" session</p>



<a name="196290593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196290593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196290593">(May 05 2020 at 10:31)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> where are you all located? what time zone, in particular? are you comfortable with spoken English or do you prefer written?</p>



<a name="196324642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196324642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196324642">(May 05 2020 at 15:33)</a>:</h4>
<p>I was thinking I will try to prepare a compiler team major change proposal here later today</p>



<a name="196325575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196325575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196325575">(May 05 2020 at 15:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/196290558" title="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/196290558">said</a>:</p>
<blockquote>
<p>I remember <span class="user-mention silent" data-user-id="128294">blitzerr</span> and I recorded some videos --</p>
</blockquote>
<p>I can try to find those <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="196325642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196325642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196325642">(May 05 2020 at 15:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/196324642" title="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/196324642">said</a>:</p>
<blockquote>
<p>I was thinking I will try to prepare a compiler team major change proposal here later today</p>
</blockquote>
<p>Awesome !!</p>



<a name="196339336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196339336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196339336">(May 05 2020 at 17:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  We are in Canada, Eastern Timzone (UTC−04:00). I'm conformable with both written and spoken English.  <span class="user-mention" data-user-id="281952">@Chris Pardy</span>  is one of my teammates and might be able to join in as well.</p>



<a name="196339391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196339391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196339391">(May 05 2020 at 17:27)</a>:</h4>
<p>I was thinking that it'd be kind of nice if we can get some other "semi-experienced" compiler person in here</p>



<a name="196339418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196339418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196339418">(May 05 2020 at 17:27)</a>:</h4>
<p>like, I'd be happy to work out the plan, but my availability is often low,</p>



<a name="196339437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196339437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196339437">(May 05 2020 at 17:27)</a>:</h4>
<p>so I'm thinking about trying to draft someone to help answer questions that arise and surface the harder ones to me</p>



<a name="196339555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196339555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196339555">(May 05 2020 at 17:28)</a>:</h4>
<p>That's fair, we'd appreciate all the help we can get.  Thank you :)</p>



<a name="196340397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196340397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196340397">(May 05 2020 at 17:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/196290558" title="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/196290558">said</a>:</p>
<blockquote>
<p>I remember <span class="user-mention silent" data-user-id="128294">blitzerr</span> and I recorded some videos --</p>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  They can be found <a href="https://www.youtube.com/playlist?list=PL85XCvVPmGQh__bxYIxaVifbIOajnrNcQ&amp;disable_polymer=true" title="https://www.youtube.com/playlist?list=PL85XCvVPmGQh__bxYIxaVifbIOajnrNcQ&amp;disable_polymer=true">here</a></p>



<a name="196689582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196689582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196689582">(May 06 2020 at 20:05)</a>:</h4>
<p>So let's shoot to have some synchronous discussion on this next week</p>



<a name="196689703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196689703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196689703">(May 06 2020 at 20:06)</a>:</h4>
<p>But I think I"m definitely going to need a bit of a "co-lead"  here -- someone to keep track of what's going on, etc</p>



<a name="196689714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196689714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196689714">(May 06 2020 at 20:06)</a>:</h4>
<p>I'm not sure who would be best suited for it :)</p>



<a name="196689784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196689784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196689784">(May 06 2020 at 20:06)</a>:</h4>
<p>I'm going to reach out a bit about that</p>



<a name="196690325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196690325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196690325">(May 06 2020 at 20:11)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> <span class="user-mention" data-user-id="281950">@Aman Arora</span> <span class="user-mention" data-user-id="281952">@Chris Pardy</span> here is a <a href="https://doodle.com/poll/cyxmz746z5xq2b8x" title="https://doodle.com/poll/cyxmz746z5xq2b8x">doodle poll</a> with possible times to meet next week. Those all more-or-less work for me. It'd be good to get a sense for which ones work for you. (Just for a one-off meeting to get synchronized initially.)</p>



<a name="196700269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196700269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196700269">(May 06 2020 at 21:29)</a>:</h4>
<p>Also, I started working out a <a href="https://hackmd.io/HNEgTkPlTuy6cb9v29rzIQ" title="https://hackmd.io/HNEgTkPlTuy6cb9v29rzIQ">plan</a>, which you can read here</p>



<a name="196700327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196700327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196700327">(May 06 2020 at 21:29)</a>:</h4>
<p>I'll try to dress it up a bit and move it to an MCP, I need to look a bit further down the line to think about the steps after these refactorings, didn't quite get that far</p>



<a name="196700345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196700345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196700345">(May 06 2020 at 21:29)</a>:</h4>
<p>I'd lke to do that and then maybe try to tempt some people to co-lead the effort</p>



<a name="196700507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196700507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196700507">(May 06 2020 at 21:30)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span>, <span class="user-mention" data-user-id="281952">@Chris Pardy</span> I also want to raise two questions</p>
<ul>
<li>what is your experience level with compilers, Rust, and/or rustc?</li>
<li>if we decide that this effort is not going to work out, are you interested in alternative projects? Or does it have to be this change :)</li>
</ul>
<p>To be clear, I really want this change to go through, but I also don't want to "resurrect" it only to have it stall out again, so I want to be sure we have the bandwidth to support you folks.</p>



<a name="196704725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196704725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196704725">(May 06 2020 at 22:09)</a>:</h4>
<p>We are still beginners in Rust, we have fair amount of experience with C++ and memory management from school and for some of us from internships as well. </p>
<p>All of us have taken a course on Operating System and a beginners one on Compilers. Some of us have taken course on type theory as well. </p>
<p>I just finished an internship on MSVC, I was working with type information. </p>
<p>We haven't looked through rustc codebase yet, but our plan was to do some E-easy/E-mentor labelled issues on Github.</p>
<p>We had previously talked to centril and discussed couple different projects with out team and this one (2229) won unanimously. That said we are open to similar ideas and I can discuss interest and feasibility with our team</p>



<a name="196708334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196708334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196708334">(May 06 2020 at 22:54)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> ok -- in the plan I wrote-up, the first issues are actually quite easy as well, as i inclinded some links to the rustc-dev-guide to help explain some of the underlying concepts.</p>



<a name="196910795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196910795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196910795">(May 08 2020 at 15:35)</a>:</h4>
<p>OK, I forgot to make a decision here!</p>



<a name="196911244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196911244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196911244">(May 08 2020 at 15:38)</a>:</h4>
<p><a href="https://calendar.google.com/event?action=TEMPLATE&amp;tmeid=MDZvbGpjbzRvZW5iNmZ1aGZhcTAzMjRkb2ggNnU1cnJ0Y2U2bHJ0djA3cGZpM2RhbWdqdXNAZw&amp;tmsrc=6u5rrtce6lrtv07pfi3damgjus%40group.calendar.google.com" title="https://calendar.google.com/event?action=TEMPLATE&amp;tmeid=MDZvbGpjbzRvZW5iNmZ1aGZhcTAzMjRkb2ggNnU1cnJ0Y2U2bHJ0djA3cGZpM2RhbWdqdXNAZw&amp;tmsrc=6u5rrtce6lrtv07pfi3damgjus%40group.calendar.google.com">Calendar event created</a> -- meeting time is Tuesday May 12 at 15:00 US Eastern time. There is a Zoom URL attached, since I think it'd be useful to start with Zoom (maybe?)</p>



<a name="196911373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196911373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196911373">(May 08 2020 at 15:39)</a>:</h4>
<p>I can add folks to the event if you send me your e-mails (privmsg is fine..)</p>



<a name="196911528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196911528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196911528">(May 08 2020 at 15:40)</a>:</h4>
<p>(Er, no, I grabbed them from Zulip)</p>



<a name="196945664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196945664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196945664">(May 08 2020 at 20:19)</a>:</h4>
<p>I just issued a Major Change Proposal: <a href="https://github.com/rust-lang/compiler-team/issues/292" title="https://github.com/rust-lang/compiler-team/issues/292">https://github.com/rust-lang/compiler-team/issues/292</a></p>



<a name="196945690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196945690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196945690">(May 08 2020 at 20:19)</a>:</h4>
<p>I also thought more about the overall plan and tried to sketch out more details in the hackmd</p>



<a name="196945712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196945712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196945712">(May 08 2020 at 20:19)</a>:</h4>
<p>you might want to follow along with <a class="stream-topic" data-stream-id="233931" href="/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/RFC.202229.20implementation.20plan.20compiler-team.23292">#t-compiler/major changes &gt; RFC 2229 implementation plan compiler-team#292</a></p>



<a name="196945864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196945864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196945864">(May 08 2020 at 20:21)</a>:</h4>
<p>Thank you, will go through the discussion there</p>



<a name="196962368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/196962368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#196962368">(May 08 2020 at 23:41)</a>:</h4>
<p>Thanks a lot <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="197321765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197321765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197321765">(May 12 2020 at 18:56)</a>:</h4>
<p>Hey all -- so the call is coming up soon</p>



<a name="197321780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197321780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197321780">(May 12 2020 at 18:56)</a>:</h4>
<p>I may be a minute or two late</p>



<a name="197322020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197322020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197322020">(May 12 2020 at 18:58)</a>:</h4>
<p>No worries</p>



<a name="197330240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197330240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197330240">(May 12 2020 at 20:00)</a>:</h4>
<p>the hackmd doc I've been editing btw : <a href="https://hackmd.io/5N94DPFWQwCbjfYPMXFyGA">https://hackmd.io/5N94DPFWQwCbjfYPMXFyGA</a></p>



<a name="197615225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197615225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197615225">(May 14 2020 at 20:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ,  can you upload the video from out Zoom meeting? It will be great to go over with our team over the weekend</p>



<a name="197621988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197621988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197621988">(May 14 2020 at 21:41)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> yep!</p>



<a name="197622192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197622192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197622192">(May 14 2020 at 21:43)</a>:</h4>
<p>thank you</p>



<a name="197622304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197622304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197622304">(May 14 2020 at 21:44)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> it is uploading and processing but <a href="https://youtu.be/41pnkSS6MzY">will be available here</a></p>
<div class="youtube-video message_inline_image"><a data-id="41pnkSS6MzY" href="https://youtu.be/41pnkSS6MzY"><img src="https://i.ytimg.com/vi/41pnkSS6MzY/default.jpg"></a></div>



<a name="197622323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197622323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197622323">(May 14 2020 at 21:44)</a>:</h4>
<p>awesome</p>



<a name="197695989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197695989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197695989">(May 15 2020 at 14:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> indicated they'd like to follow along</p>



<a name="197706322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197706322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197706322">(May 15 2020 at 15:12)</a>:</h4>
<p>btw, <a href="https://github.com/rust-lang/rustc-dev-guide/issues/704">https://github.com/rust-lang/rustc-dev-guide/issues/704</a></p>



<a name="197708916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197708916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197708916">(May 15 2020 at 15:29)</a>:</h4>
<p>Thanks a lot <span class="user-mention" data-user-id="198054">@mark-i-m</span></p>



<a name="197967495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197967495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197967495">(May 18 2020 at 17:23)</a>:</h4>
<p>Hey <span class="user-group-mention" data-user-group-id="1175">@WG-rfc-2229</span> -- i've updated this user group to include <span class="user-mention" data-user-id="281950">@Aman Arora</span>, <span class="user-mention" data-user-id="281952">@Chris Pardy</span>, and <span class="user-mention" data-user-id="116118">@Matthew Jasper</span></p>



<a name="197967614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197967614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197967614">(May 18 2020 at 17:24)</a>:</h4>
<p>It already included <span class="user-mention" data-user-id="116773">@csmoe</span> and .. somebody else whose name I already forgot, sorry .. if y'all are interested, great! If not, maybe you want to remove yourselves.</p>



<a name="197967621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197967621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197967621">(May 18 2020 at 17:24)</a>:</h4>
<p>I'm going to update the team repository as well</p>



<a name="197967635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197967635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197967635">(May 18 2020 at 17:24)</a>:</h4>
<p>But I wanted to discuss a bit how to organize ourselves</p>



<a name="197967655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197967655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197967655">(May 18 2020 at 17:24)</a>:</h4>
<p>Should we setup a sync time? <span class="user-mention" data-user-id="281950">@Aman Arora</span> et al. are you planning to get started on some PRs?</p>



<a name="197967702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197967702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197967702">(May 18 2020 at 17:24)</a>:</h4>
<p>To update the team repository, I will need github usernames for everyone who wants to be listed as part of the group</p>



<a name="197985310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/197985310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#197985310">(May 18 2020 at 19:36)</a>:</h4>
<p>Hi my github's <code>arora-aman</code> and <span class="user-mention" data-user-id="281952">@Chris Pardy</span>  's is <code>ChrisPardy</code>.  We'll try get back to you next week about a plan/schedule</p>



<a name="198714867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198714867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198714867">(May 26 2020 at 02:15)</a>:</h4>
<p>Status update: We are trying to get most of the initial refactor work PRs out by the next week. We can sync once we are ready to begin work on refactoring upvars to capture HIR Places.</p>



<a name="198762701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198762701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198762701">(May 26 2020 at 13:39)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> great! I just saw <a href="https://github.com/sexxi-goose/rust/pull/3">https://github.com/sexxi-goose/rust/pull/3</a> but I'm not sure if you were looking for feedback from me there</p>



<a name="198765027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198765027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198765027">(May 26 2020 at 13:56)</a>:</h4>
<p>There's <a href="https://github.com/rust-lang/rust/issues/72591">#72591</a></p>



<a name="198765661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198765661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198765661">(May 26 2020 at 14:01)</a>:</h4>
<p>ah, excellent</p>



<a name="198772454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198772454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198772454">(May 26 2020 at 14:47)</a>:</h4>
<p>The prs on our fork are for us to review amongst ourselves before we open a PR on rust-lang</p>



<a name="198854080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198854080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198854080">(May 27 2020 at 06:33)</a>:</h4>
<p>Just to check that I'm understanding things correctly, If we store HIR Place in the upvars query and we just use <code>hir_id</code> from Place  in the capture list , we'll end up with what we have today? </p>
<p>HIR place: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/struct.Place.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/struct.Place.html</a></p>
<p>However to get the minimal capture from this, if we have Place a, Place b in my upvars, with projections P_a_0 ... P_a_n and P_b_0 .... P_b_m, then if for some i &gt; 0 (P_a_i, ..., P_a_n) == (P_b_0, ..., P_b_m) then we select b, else we keep both? (for n &gt; m)</p>



<a name="198854718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198854718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198854718">(May 27 2020 at 06:45)</a>:</h4>
<p>(deleted)</p>



<a name="198902266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198902266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198902266">(May 27 2020 at 14:49)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I don't quite understand the question</p>



<a name="198918814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198918814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198918814">(May 27 2020 at 16:43)</a>:</h4>
<p>The first one is to understand how HIR Place and HIR id work. <br>
For 2229 going forward we want to use HIR Place instead of id to list mentioned upvars and paths captured by the closure.  <br>
If I understand how the relation between Place and id work then, if instead of using HIR place for captured paths, instead I use a set of Hir ids which I get from Place::hir_id, the implementation will be same as the current non-2229 rustc? </p>
<p>Second one is to understand how projections work and if are some corner cases/subtle things about them. </p>
<p>So based on the HIR Place doc a.b.c will have [a.b.c, a.b] as the set of projections? </p>
<p>If that is the case then to do a minimal captured Places (capturing a.b when closure mentions a.b.c and a.b) as part of 2229,  can we look at the list of projections to make the decision?</p>



<a name="198920387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920387">(May 27 2020 at 16:55)</a>:</h4>
<p>Oh, hmm, I hadn't actually noticed that a HIR Place has a <code>hir_id</code></p>



<a name="198920394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920394">(May 27 2020 at 16:55)</a>:</h4>
<p>I think that's a slight problem</p>



<a name="198920460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920460">(May 27 2020 at 16:56)</a>:</h4>
<p>I wonder if we could refactor it out</p>



<a name="198920490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920490">(May 27 2020 at 16:56)</a>:</h4>
<p>We have to make some changes to HIR place anyway</p>



<a name="198920503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920503">(May 27 2020 at 16:56)</a>:</h4>
<p>So, to back up</p>



<a name="198920581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920581">(May 27 2020 at 16:56)</a>:</h4>
<p>I believe the old table directly stored a <code>HirId</code>-- actually I'd have to dobule check -- but in any case that id was the id <strong>of the local variable</strong> that was captured</p>



<a name="198920606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920606">(May 27 2020 at 16:57)</a>:</h4>
<p>this id is also present in a HIR place, but not in the <code>hir_id</code> field</p>



<a name="198920638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920638">(May 27 2020 at 16:57)</a>:</h4>
<p>if you look at the <code>base</code> field (of type <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/enum.PlaceBase.html"><code>PlaceBase</code></a>) you will see that it has a variant <code>Local(HirId)</code></p>



<a name="198920659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920659">(May 27 2020 at 16:57)</a>:</h4>
<p>this would be the hir-id of the variable</p>



<a name="198920690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920690">(May 27 2020 at 16:57)</a>:</h4>
<p>in contrast, the <code>hir_id</code> field on a <code>Place</code> is, I believe, the id of some <em>use</em> of the variable</p>



<a name="198920706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920706">(May 27 2020 at 16:57)</a>:</h4>
<p>the difference is roughly</p>



<a name="198920810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920810">(May 27 2020 at 16:58)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span><span class="p">;</span><span class="w">  </span><span class="c1">// the `x` here `HirId` N, let&#39;s say</span>
<span class="o">..</span><span class="p">.</span><span class="w"></span>

<span class="k">use</span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"> </span><span class="c1">// this might have `HirId` N1</span>
</code></pre></div>



<a name="198920848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920848">(May 27 2020 at 16:58)</a>:</h4>
<p>we would construct a <code>Place</code> for the <code>x</code> in <code>use(x)</code>, but the <code>hir_id</code> would be N1</p>



<a name="198920880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920880">(May 27 2020 at 16:59)</a>:</h4>
<p>whereas the <code>HirId</code> stored in the <code>base</code> field would be <code>N</code> (and that's the one we want)</p>



<a name="198920930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920930">(May 27 2020 at 16:59)</a>:</h4>
<p>the reason I was not happy to see that <code>Place</code> has a <code>hir_id</code> is because it therefore refers to <em>some specific reference to the place</em> versus <em>the place itself</em></p>



<a name="198920943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920943">(May 27 2020 at 16:59)</a>:</h4>
<p>in other words, we want to capture <code>x</code> (or <code>*x</code>, or whatever)</p>



<a name="198920964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198920964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198920964">(May 27 2020 at 16:59)</a>:</h4>
<p>but we don't want to necessarily tie that to some expression in the code</p>



<a name="198921090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921090">(May 27 2020 at 17:00)</a>:</h4>
<p>With the current setup, if you have <code>|| use(x.foo, x.foo)</code>, then the <code>Place</code> for <code>x.foo</code> would be different depending on which <code>x.foo</code> it was (each has a distinct id in the tree)</p>



<a name="198921120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921120">(May 27 2020 at 17:00)</a>:</h4>
<p>but we just want to refer to the "concept" of <code>x.foo</code>, distinct from any particular expression that it derived from</p>



<a name="198921142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921142">(May 27 2020 at 17:00)</a>:</h4>
<p>anyway we can fix this, not a big thing</p>



<a name="198921150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921150">(May 27 2020 at 17:01)</a>:</h4>
<p>How do the projections in Place help with this</p>



<a name="198921168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921168">(May 27 2020 at 17:01)</a>:</h4>
<p>(but it might be a step we need to take)</p>



<a name="198921188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921188">(May 27 2020 at 17:01)</a>:</h4>
<p>I have to run, have a meeting, more later, but the projections express the <code>.foo</code> part</p>



<a name="198921217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921217">(May 27 2020 at 17:01)</a>:</h4>
<p>the "base" captures the start of the expression (<code>x</code>), the projections the things we add on</p>



<a name="198921232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921232">(May 27 2020 at 17:01)</a>:</h4>
<p>Can we not just rely on base + projections to get the path?</p>



<a name="198921402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198921402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198921402">(May 27 2020 at 17:02)</a>:</h4>
<p>Though I think we need to update the typechk categorization code to generate projetions for upvars <a href="https://github.com/sexxi-goose/rust/blob/master/src/librustc_typeck/mem_categorization.rs#L486">https://github.com/sexxi-goose/rust/blob/master/src/librustc_typeck/mem_categorization.rs#L486</a></p>



<a name="198922264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198922264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198922264">(May 27 2020 at 17:08)</a>:</h4>
<p>That will be done by <code>cat_projection</code>/<code>cat_pattern</code> if needed.</p>



<a name="198922468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/198922468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#198922468">(May 27 2020 at 17:10)</a>:</h4>
<p>Okay yeah that's what I was thinking, though might have to make sure we don't do such computation twice.  Because currently at some point later we are probably computing how to read the  path to the actual member</p>



<a name="199050909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199050909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199050909">(May 28 2020 at 17:09)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Did you mean using PlaceBase::Upvar and then access the UpvarPath?  Also should we be using Projections for minimal capture or is there a better way? As far as I can see projections are only being used for linting</p>



<a name="199077542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199077542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199077542">(May 28 2020 at 20:00)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> Presently projections are not used for much in that structure, but this will change (and indeed the projection structure will have to be fleshed out, as it's currently rather imprecise)</p>



<a name="199077657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199077657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199077657">(May 28 2020 at 20:01)</a>:</h4>
<p>Whether we use <code>PlaceBase::Upvar</code> ... well ... <em>probably</em> yes but that's an interesting question</p>



<a name="199077680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199077680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199077680">(May 28 2020 at 20:01)</a>:</h4>
<p>I guess mostly a terminology question</p>



<a name="199077831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199077831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199077831">(May 28 2020 at 20:02)</a>:</h4>
<p>I guess I would propose "capture" be the term for "some field of the closure" (which references some path/"place expression" in the creator)</p>



<a name="199077899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199077899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199077899">(May 28 2020 at 20:02)</a>:</h4>
<p>and in that case "upvar" maybe yes refers explicitly to the root variable that is the start of those paths...</p>



<a name="199105600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199105600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199105600">(May 29 2020 at 01:44)</a>:</h4>
<p>Just to confirm: <br>
1) Going forward we have two terminology -- Upvar (these are what are mentioned in the closure) and Captures that be the Paths and places that will be captured. <br>
2) <code>HirId</code> we get from upvars_mentioned refers to accessing the exact member. <br>
3)  typechk/check/upvars works with expr_use_visitor and mem_categorization to create Places and then uses the HirId associated with the place to keep to track of captures.<br>
4) Currently, PlaceBase::Local are the local variables and arguments to the closure and PlaceBase::Upvar are the captured variables?</p>
<p>If 2 and 3 are correct then, (from <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/expr_use_visitor.rs#L542">https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/expr_use_visitor.rs#L542</a>)</p>
<div class="codehilite"><pre><span></span><code><span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">upvars</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">upvars_mentioned</span><span class="p">(</span><span class="n">closure_def_id</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;</span><span class="n">var_id</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">upvars</span><span class="p">.</span><span class="n">keys</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">upvar_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ty</span>::<span class="n">UpvarId</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="n">var_path</span>: <span class="nc">ty</span>::<span class="n">UpvarPath</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">hir_id</span>: <span class="nc">var_id</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="w">                    </span><span class="n">closure_expr_id</span>: <span class="nc">closure_def_id</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="p">};</span><span class="w"></span>
</code></pre></div>


<p>Doesn't this actually give us the path to the member variable? </p>
<p>Also do you have any thoughts how HIR Place should be modified to <br>
1) Handle the hir_id differences? Are we just going to remove the field? <br>
2) Improve projections<br>
3) For naming convention do we add PlaceBase::Captured of just do a rename PlaceBase::Upvar -&gt; PlaceBase::Captured</p>



<a name="199121426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199121426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199121426">(May 29 2020 at 07:25)</a>:</h4>
<p>1) yes.<br>
2) The HirId in <code>upvars_mentioned</code> refers to the local declaration (<code>hir::PatKind::Binding</code>), not the exact path.<br>
3) <code>upvars</code> probably won't use that <code>HirId</code>, except possibly for diagnostic information. It will primarily use the base and projections of the place.<br>
4) Yes</p>
<p>1) The field is used by <br>
2) Yes<br>
3) No, we keep <code>PlaceBase::Upvar</code>, this is the code that's determining what the captures are</p>



<a name="199132567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199132567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199132567">(May 29 2020 at 09:32)</a>:</h4>
<p>I think that to refactor <code>hir::Place</code>...</p>



<a name="199132573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199132573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199132573">(May 29 2020 at 09:32)</a>:</h4>
<p>well, let's move that to its own topic</p>



<a name="199188198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199188198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199188198">(May 29 2020 at 17:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span>  can you give an example for how the local declaration (<code>hir::PatKind::Binding</code>) would look like?</p>



<a name="199190813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199190813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199190813">(May 29 2020 at 18:08)</a>:</h4>
<p>To give an example of everything:</p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">f</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">my_var</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="mi">456</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">closure</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nb">drop</span><span class="p">(</span><span class="n">my_var</span><span class="p">.</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p><code>my_var</code> in the <code>let</code> binding would be represented as</p>
<div class="codehilite"><pre><span></span><code>hir::Pat {
    hir_id: /* some Id */,
    span: /* span of my_var in the binding */,
    kind: PatKind::Binding(
       BindingAnnotation::Unannotated,
       /* the same HirId (this is only different in or-patterns) */,
       &quot;my_var&quot;,
        None,
    )
}
</code></pre></div>


<p>In the closure the <code>ExprUseVisitor</code> would call <code>cosume(place, ConsumeMode::Copy)</code> on it's delegate and <code>place</code> would be:</p>
<div class="codehilite"><pre><span></span><code>Place {
    hir_id: /* HirId of the expression `my_var.0` within the closure */,
    span: /* Span of `my_var.0` within the closure */,
    ty: &quot;i32&quot;,
    base: PlaceBase::Upvar(UpvarId { UpvarPath { hir_id: /* HirId described above * }, closure_expr_id: /* LocalDefId of the closure */ }),
    projections: [Projection::Other]. // This will become something like `Projection::Field(0)`.
}
</code></pre></div>



<a name="199198241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199198241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199198241">(May 29 2020 at 19:08)</a>:</h4>
<p>Thanks!</p>



<a name="199705491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199705491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199705491">(Jun 04 2020 at 05:00)</a>:</h4>
<p>So we were working on using <code>closure_captures</code> instead of <code>upvars_mentioned</code>, once the type chk part is done. Green lit places here -&gt; <a href="https://hackmd.io/HNEgTkPlTuy6cb9v29rzIQ">https://hackmd.io/HNEgTkPlTuy6cb9v29rzIQ</a> </p>
<p>We noticed that <code>upvars_mentioned</code> returns an Option&lt;IndexMap&gt; where as ClosureCapture returns the map directly. It doens't really cause a problem becuase the captures map an just be empty. </p>
<p>Just curious about the differences -- Is the reason behind this because the query returning an Option related to lazy eval?</p>



<a name="199736305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199736305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199736305">(Jun 04 2020 at 12:03)</a>:</h4>
<p>I'm not sure why it returns an <code>Option</code> actually</p>



<a name="199736529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199736529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199736529">(Jun 04 2020 at 12:05)</a>:</h4>
<p>oh it's an <code>Option&lt;&amp;IndexMap&gt;</code> -- the reason then is because returning <code>None</code> avoids allocating any memory from the arena for an empty index map</p>



<a name="199736550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/199736550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#199736550">(Jun 04 2020 at 12:05)</a>:</h4>
<p>if the query returned <code>Option&lt;IndexMap&gt;</code> then there would be no real advantage to the <code>Option</code></p>



<a name="201345866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201345866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201345866">(Jun 19 2020 at 02:06)</a>:</h4>
<p>I'm curious as to how borrowing works for member fields outside of closures? I understand that closures itself represent information for more than itself (variable/paramater that is a closure) and hence is complicated. </p>
<p>From the surface it feels like we are adding a bunch of analysis (eg Field), that is already happening outside the context of closures.</p>



<a name="201392732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201392732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201392732">(Jun 19 2020 at 13:53)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> hmm i'm not sure if I understand the question exactly</p>



<a name="201392855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201392855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201392855">(Jun 19 2020 at 13:54)</a>:</h4>
<p>one of the interesting things here is that</p>



<a name="201392895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201392895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201392895">(Jun 19 2020 at 13:54)</a>:</h4>
<p>if by "how borrowing works" you are referring to the "borrow check", i.e., the part of the compiler that determines when borrows are legal</p>



<a name="201392905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201392905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201392905">(Jun 19 2020 at 13:54)</a>:</h4>
<p>we shouldn't have to make any changes there at all, except perhaps for error reporting</p>



<a name="201392933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201392933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201392933">(Jun 19 2020 at 13:55)</a>:</h4>
<p>instead we will change how the closure itself is <em>desugared</em> -- i.e., what MIR we construct</p>



<a name="201427510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201427510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201427510">(Jun 19 2020 at 18:50)</a>:</h4>
<p>I'm curious as to how we deal with member fields outside the context of closures? Why did we not need ProjectionKind::Field or something equivalent before this RFC in HIR ?</p>



<a name="201430051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201430051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201430051">(Jun 19 2020 at 19:17)</a>:</h4>
<p>Borrow checking works on MIR and <code>ProjectionElem</code> has a variant for fields.</p>



<a name="201431126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201431126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201431126">(Jun 19 2020 at 19:28)</a>:</h4>
<p>Why are we making Projections more precise? Is it to support only capturing a.b when a.b.c and a.b both were mentioned?</p>



<a name="201488077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201488077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201488077">(Jun 20 2020 at 17:28)</a>:</h4>
<p>They need to be able to express the places that we can capture, period</p>



<a name="201488086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201488086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201488086">(Jun 20 2020 at 17:29)</a>:</h4>
<p>right now, they only carry as much information as they had to in order to figure out which <strong>local variables</strong> needed to be captured</p>



<a name="201488090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201488090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201488090">(Jun 20 2020 at 17:29)</a>:</h4>
<p>they can't express e.g. <code>a.b.c</code> (iirc)</p>



<a name="201489780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201489780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201489780">(Jun 20 2020 at 18:10)</a>:</h4>
<p>I understand that bit, but how do we express those Places(a.b.c) outside of the context of closure today in hir?</p>



<a name="201489919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201489919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201489919">(Jun 20 2020 at 18:13)</a>:</h4>
<p>eg:</p>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="o">=</span><span class="w">  </span><span class="n">Point</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">x</span>: <span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="n">y</span>: <span class="mi">40</span><span class="w"> </span><span class="p">};</span><span class="w"></span>

<span class="kd">let</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">;</span><span class="w"></span>

<span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;{}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">);</span><span class="w"> </span><span class="c1">// Error here</span>

<span class="o">*</span><span class="n">m</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">10</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="201489933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201489933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201489933">(Jun 20 2020 at 18:13)</a>:</h4>
<p>How do we express <code>p.x</code> in HIR here?</p>



<a name="201490262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201490262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201490262">(Jun 20 2020 at 18:20)</a>:</h4>
<p>Do we not need to be precise here, because:</p>
<ul>
<li>Place in MIR will be built from the hir::Expr directly and</li>
<li>m here(in the example abovce) just holds information about p.x and we can just use the expr in MIR, whereas if it were something </li>
</ul>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="o">*</span><span class="n">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">10</span><span class="p">;</span><span class="w"></span>
<span class="p">};</span><span class="w"></span>

<span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;{}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">);</span><span class="w"> </span><span class="c1">// Error here</span>

<span class="n">m</span><span class="p">();</span><span class="w"></span>
</code></pre></div>


<p>Then m can store info about multiple different captured variables and we need to be smarter than just store the hir::Expr?</p>



<a name="201499872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201499872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201499872">(Jun 20 2020 at 21:59)</a>:</h4>
<p>and by smarter I mean use hir::Place</p>



<a name="201616575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201616575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201616575">(Jun 22 2020 at 15:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281950">Aman Arora</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/201489780">said</a>:</p>
<blockquote>
<p>I understand that bit, but how do we express those Places(a.b.c) outside of the context of closure today in hir?</p>
</blockquote>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> Ah. So. Those things are HIR <strong>expressions</strong> -- and certainly they can express anything that Rust can express. <em>However,</em> as an expression, they are very connected to "what the user wrote in a particular place", and don't capture the more "abstract concept" that a HIR place does. We don't presently have a way to describe "some place" in HIR, only in MIR, in part because we've never needed it in HIR before (well, this is not quite true, we <em>used</em> to have a data structure that served that role, but it was removed when we introduced the MIR-based borrow checker because it was no longer needed; and anyway it was clunky)</p>



<a name="201616887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201616887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201616887">(Jun 22 2020 at 15:02)</a>:</h4>
<p>Among other things, HIR expressions are not canonicalized, so something like <code>a.b</code> may have auto-derefs etc that make it equivalent to the place <code>(*a).b</code> but that is not captured in HIR (the HIR is constructed before we know about those auto-derefs; we use it to <em>figure out</em> where auto-derefs are needed). The HIR also doesn't have type information or other stuff like that -- e.g., it stores a field name, but not the field's <code>DefId</code>. We use the HIR to figure out all that sort of thing as well.</p>



<a name="201616917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201616917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201616917">(Jun 22 2020 at 15:02)</a>:</h4>
<p>We store "extra information" about the HIR (what we figured out, basically) in side-tables found in the <code>TypeckTables</code> and indexed by the <code>HirId</code></p>



<a name="201616953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201616953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201616953">(Jun 22 2020 at 15:03)</a>:</h4>
<p>But the idea of the HIR place data structure is basically to represent the "output" of that analysis and to capture the "abstract notion" of a place expression</p>



<a name="201616961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201616961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201616961">(Jun 22 2020 at 15:03)</a>:</h4>
<p>Does that help, <span class="user-mention" data-user-id="281950">@Aman Arora</span> ?</p>



<a name="201617761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201617761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201617761">(Jun 22 2020 at 15:09)</a>:</h4>
<p>I guess to answer your more direct question:</p>
<blockquote>
<p>Do we not need to be precise here, because:</p>
<ul>
<li>Place in MIR will be built from the hir::Expr directly and</li>
</ul>
</blockquote>
<p>Yes</p>
<blockquote>
<ul>
<li>m here(in the example abovce) just holds information about p.x </li>
</ul>
</blockquote>
<p>I'm not sure what this means but <code>m</code> is a variable of type <code>&amp;mut i32</code> or something like that. The compiler doesn't know of any particular relationship between it and <code>p.x</code> -- of course, during borrow check, we do compute and understand something about this relationship, but at the stages of compilation we are talking about here, we don't (and we don't need to).</p>
<blockquote>
<p>and we can just use the expr in MIR, whereas if it were something </p>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="o">*</span><span class="n">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">10</span><span class="p">;</span><span class="w"></span>
<span class="p">};</span><span class="w"></span>

<span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;{}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">);</span><span class="w"> </span><span class="c1">// Error here</span>

<span class="n">m</span><span class="p">();</span><span class="w"></span>
</code></pre></div>


<p>Then m can store info about multiple different captured variables and we need to be smarter than just store the hir::Expr?</p>
</blockquote>
<p>In this case, <code>m</code> would be a closure variable. The "MIR" you get from that particular bit of code looks something like (i.e., this is how the MIR would think of it):</p>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ClosureStruct22</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">p</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;{}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
</code></pre></div>


<p>In particular, the body of the closure is nowhere to be seen, and the <code>|| ...</code> expression just constructs a data structure that looks much like a struct.</p>



<a name="201617849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201617849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201617849">(Jun 22 2020 at 15:10)</a>:</h4>
<p>What we will change is that the MIR would look more like</p>
<div class="codehilite"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ClosureStruct22</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">px</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="o">..</span><span class="p">.</span><span class="w"></span>
</code></pre></div>



<a name="201624628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201624628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201624628">(Jun 22 2020 at 15:59)</a>:</h4>
<p>That helps a lot, thank you :)</p>



<a name="201644053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644053">(Jun 22 2020 at 18:36)</a>:</h4>
<blockquote>
<p>The HIR also doesn't have type information or other stuff like that -- e.g., it stores a field name, but not the field's DefId. We use the HIR to figure out all that sort of thing as well.</p>
</blockquote>
<p>Do we ever compute information related to fields that are in the middle? So for <code>a.b.c</code> do we compute what  type of <code>a.b</code> is, in typeck?</p>
<p>Asking that because it might be good to document for <a href="https://github.com/rust-lang/project-rfc-2229/issues/5">#5</a>, if just need to rewire the interfaces so that we store the type information in the projections, or if need to compute that information?</p>



<a name="201644156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644156">(Jun 22 2020 at 18:37)</a>:</h4>
<p>we do compute that, and it is stored in those typeck tables</p>



<a name="201644192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644192">(Jun 22 2020 at 18:37)</a>:</h4>
<p>you'll find that the code is already passing it around</p>



<a name="201644199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644199">(Jun 22 2020 at 18:37)</a>:</h4>
<p>it's just that it gets discarded right now</p>



<a name="201644213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644213">(Jun 22 2020 at 18:37)</a>:</h4>
<p>that is, right now, the only place the "type" is stored is in the <code>Place</code> data structure</p>



<a name="201644228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644228">(Jun 22 2020 at 18:37)</a>:</h4>
<p>instead, we would store it alongside the "base" and each "projection"</p>



<a name="201644284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644284">(Jun 22 2020 at 18:38)</a>:</h4>
<p>Okay that's what it looked like, thanks</p>



<a name="201644285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644285">(Jun 22 2020 at 18:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/starting.20up.20work.20again/near/201644213">said</a>:</p>
<blockquote>
<p>that is, right now, the only place the "type" is stored is in the <code>Place</code> data structure</p>
</blockquote>
<p>(and then it gets discarded when a projection is added, and the new place encodes the new final type)</p>



<a name="201644324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/starting%20up%20work%20again/near/201644324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/starting.20up.20work.20again.html#201644324">(Jun 22 2020 at 18:38)</a>:</h4>
<p>okay, thanks</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>